package com.ysw.rpc.client.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author YinShangwen
 * @since 2023/4/16 16:39
 */
@Getter
@AllArgsConstructor
public enum ConnectionEnum {
    /**
     *
     */
    SINGLE_LONG_CONNECTION("single-long", "单一长连接"),
    SHORT_CONNECTION("short", "短连接");
    private final String code;
    private final String desc;

    public static boolean isSingleLong(String code) {
        return Objects.equals(SINGLE_LONG_CONNECTION.code, code);

    }

    public static boolean isShort(String code) {
        return Objects.equals(SHORT_CONNECTION.code, code);
    }
}
